<?php
/**
 * 输出日志
 *
 */
class MyLog {
	/**
	 * 
	 * file pointer
	 */
	var $_handle = null;

	function MyLog($log_file_path){
		if( is_writable($log_file_path) ){
			$this->_handle = fopen( $log_file_path,'a');
		}
	}
	
	function output($str = '') {
		if(!$this->_handle){
			return;
		}
		return fwrite($this->_handle,$str."\n");
	}

	/**
	 * judge if the log is alright
	 *
	 */
	function is_log() {
		if ( $this->_handle )
			return true;
		return false;
	}
}

?>
